#ifndef COMMON_H
#define COMMON_H
#include <stdint.h>
typedef uint8_t  pixel;
typedef int16_t  dctcoef;
typedef uint16_t udctcoef;

#define FENC_STRIDE 16
#define FDEC_STRIDE 32

#define FENC_HEIGHT     48
#define FDEC_HEIGHT     54
#define QP_MAX_SPEC     51

enum cqm4_e
{
    CQM_IY = 0,
    CQM_PY = 1,
    CQM_IC = 2,
    CQM_PC = 3,
    CQM_BUTT,
};

#define X264_MIN(a,b) ( (a)<(b) ? (a) : (b) )
typedef struct picture {
    pixel   fenc_buf[FENC_HEIGHT][FENC_STRIDE];
    pixel   fdec_buf[FDEC_HEIGHT][FDEC_STRIDE];

    pixel *p_fenc[3];
    pixel *p_fdec[3];
} picture_t;

pixel x264_clip_pixel(int x );

#endif